/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Diego_M
 */
@Entity
@Table(name = "facxservicios", catalog = "peludb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Facxservicios.findAll", query = "SELECT f FROM Facxservicios f"),
    @NamedQuery(name = "Facxservicios.findByNrofac", query = "SELECT f FROM Facxservicios f WHERE f.facxserviciosPK.nrofac = :nrofac"),
    @NamedQuery(name = "Facxservicios.findBySerCod", query = "SELECT f FROM Facxservicios f WHERE f.facxserviciosPK.serCod = :serCod"),
    @NamedQuery(name = "Facxservicios.findByMonto", query = "SELECT f FROM Facxservicios f WHERE f.monto = :monto")})
public class Facxservicios implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected FacxserviciosPK facxserviciosPK;
    @Column(name = "monto")
    private Integer monto;
    @JoinColumn(name = "ser_cod", referencedColumnName = "ser_cod", nullable = false, insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Servicios servicios;
    @JoinColumn(name = "Nro_fac", referencedColumnName = "Nro_fac", nullable = false, insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Facturas facturas;

    public Facxservicios() {
    }

    public Facxservicios(FacxserviciosPK facxserviciosPK) {
        this.facxserviciosPK = facxserviciosPK;
    }

    public Facxservicios(int nrofac, int serCod) {
        this.facxserviciosPK = new FacxserviciosPK(nrofac, serCod);
    }

    public FacxserviciosPK getFacxserviciosPK() {
        return facxserviciosPK;
    }

    public void setFacxserviciosPK(FacxserviciosPK facxserviciosPK) {
        this.facxserviciosPK = facxserviciosPK;
    }

    public Integer getMonto() {
        return monto;
    }

    public void setMonto(Integer monto) {
        this.monto = monto;
    }

    public Servicios getServicios() {
        return servicios;
    }

    public void setServicios(Servicios servicios) {
        this.servicios = servicios;
    }

    public Facturas getFacturas() {
        return facturas;
    }

    public void setFacturas(Facturas facturas) {
        this.facturas = facturas;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (facxserviciosPK != null ? facxserviciosPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Facxservicios)) {
            return false;
        }
        Facxservicios other = (Facxservicios) object;
        if ((this.facxserviciosPK == null && other.facxserviciosPK != null) || (this.facxserviciosPK != null && !this.facxserviciosPK.equals(other.facxserviciosPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.Facxservicios[ facxserviciosPK=" + facxserviciosPK + " ]";
    }
    
}
